<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ taglib uri="http://www.springframework.org/security/tags" prefix="sec"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script type="text/javascript">
	window.jQuery || document.write('<script type="text/javascript" src="${pageContext.request.contextPath}/static/js/jquery/jquery-2.1.3.js"><\/script>')
</script>
</head>
<body>
	<table>
		<thead>
			<tr>
				<td>Title</td>
				<sec:authorize ifAnyGranted="${ advertiserRole }">
				<td>Text abstract</td>
				</sec:authorize>
			</tr>
		</thead>
		<tbody>
			<c:if test="${ not empty searchResults }">
				<c:forEach var="currentResult" items="${searchResults}">
					<tr>
						<td><a href="${pageContext.request.contextPath}/adverts/view/${currentResult.advertId}">${currentResult.title}</a></td>
						<sec:authorize ifAnyGranted="${ advertiserRole }">
						<td>${currentResult.highlight}</td>
						</sec:authorize>
					</tr>
				</c:forEach>
			</c:if>
		</tbody>
	</table>
</body>
</html>
